<%@page import="cn.sendto.model.ParkInfoModel"%>
<%@page import="cn.sendto.service.ParkInfoService"%>
<%@page import="cn.sendto.model.CarInfoModel"%>
<%@page import="java.util.List"%>
<%@page import="cn.sendto.service.CarInfoService"%>
<%@page import="cn.sendto.model.ResidentInfoModel"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" errorPage="../err.jsp"%>
	  <jsp:include page="../lock.jsp"></jsp:include>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>我的车辆信息</title>
<style>
body{
margin-top: 100px; 
}
</style>
</head>
<body>
	<%
	if(session.getAttribute("loginResident") != null){
		ResidentInfoModel rim = (ResidentInfoModel) session.getAttribute("loginResident");
		CarInfoService cis = new CarInfoService();
		List<CarInfoModel> list = cis.resident(rim.getResidentId());
	%>
	<div>
		<table width="95%" class="txt12" style="background-color: #00BBEE"
			cellspacing="1" cellpadding="0">
			
			<tr style="background-color: #EEEEEE; height: 30px">
				<th>序号</th>
				<th>车牌号</th>
				<th>车辆型号</th>
				<th>颜色</th>
				<th>业主</th>
				<th>行使证号</th>
				<th>车位信息</th>
			</tr><%
				for (int i = 0; i < list.size(); i++) {
			%>
			<tr style="background-color: white; height: 25px;">
				<td align="center"><%=i + 1%></td>
				<td align="center"><%=list.get(i).getCarNum()%></td>
				<td align="center"><%=list.get(i).getCarType()%></td>
				<td align="center"><%=list.get(i).getColor()%></td>
				<td align="center"><%=cis.residentName(list.get(i).getResidentId())%></td>
				<td align="center"><%=list.get(i).getDriveNum()%></td>
				<td align="center">
					<%
						if (list.get(i).getParkId() != 0) {
									ParkInfoService pis = new ParkInfoService();
									List<ParkInfoModel> list1 = pis.park(list.get(i).getParkId());
									if (list1.size() > 0) {
										out.print(list1.get(0).getParkPosition() + "," + list1.get(0).getParkNum());
									}
								} else {
									out.print("暂无车位信息");
								}
					%>
				</td>
	<%
	}
	}
	%>
	<tr style="text-align: center;">
	<td colspan="7"><span>提示：如果信息有误，请到小区物业处修改</span></td>
	</tr>
	</table>
	</div>
</body>
</html>